<template>

    <MrCustom bg-color="bg-gradual-blue " is-back>
      <template #backText>
        返回
      </template>
    </MrCustom>
  <view>
    <tui-tabs :tabs="tabs" itemWidth="50%" :currentTab="currentTab" @change="tabChange"></tui-tabs>
    <view v-if="currentTab===0">
      <HotArticle></HotArticle>
    </view>
    <view v-if="currentTab===1">
      <MyArticle ref="myArticleRef"></MyArticle>
    </view>
  </view>
</template>

<script setup lang="ts">
import {defineExpose, ref} from "vue";
import HotArticle from "@/pages/nurse/article/components/HotArticle.vue";
import MyArticle from "@/pages/nurse/article/components/MyArticle.vue";
import MrCustom from "@/components/common/MrCustom.vue";

const currentTab = ref(0)
const myArticleRef= ref()
const tabs = ref([{
  name: '热点文章',
}, {
  name: '我的文章'
}])

const tabChange = (e: any) => {
  currentTab.value = e.index
}
const myArticleReload=()=>{
  myArticleRef.value.pageListReload()
}
defineExpose({
  myArticleReload
})
</script>

<style scoped>

</style>